home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / zgbsvx.z / zgbsvx
Encoding:
Text File  |  2002-10-03  |  15.0 KB  |  397 lines

  1.  
  2.  
  3.  
  4. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ZGBSVX - use the LU factorization to compute the solution to a complex
  10.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE ZGBSVX( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB,
  14.                         IPIV, EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR,
  15.                         WORK, RWORK, INFO )
  16.  
  17.          CHARACTER      EQUED, FACT, TRANS
  18.  
  19.          INTEGER        INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
  20.  
  21.          DOUBLE         PRECISION RCOND
  22.  
  23.          INTEGER        IPIV( * )
  24.  
  25.          DOUBLE         PRECISION BERR( * ), C( * ), FERR( * ), R( * ), RWORK(
  26.                         * )
  27.  
  28.          COMPLEX*16     AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), WORK( *
  29.                         ), X( LDX, * )
  30.  
  31. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  32.      These routines are part of the SCSL Scientific Library and can be loaded
  33.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  34.      directs the linker to use the multi-processor version of the library.
  35.  
  36.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  37.      4 bytes (32 bits). Another version of SCSL is available in which integers
  38.      are 8 bytes (64 bits).  This version allows the user access to larger
  39.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  40.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  41.      only one of the two versions; 4-byte integer and 8-byte integer library
  42.      calls cannot be mixed.
  43.  
  44. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  45.      ZGBSVX uses the LU factorization to compute the solution to a complex
  46.      system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
  47.      where A is a band matrix of order N with KL subdiagonals and KU
  48.      superdiagonals, and X and B are N-by-NRHS matrices.
  49.  
  50.      Error bounds on the solution and a condition estimate are also provided.
  51.  
  52.  
  53. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  54.      The following steps are performed by this subroutine:
  55.  
  56.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  57.         the system:
  58.            TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
  59.            TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  71.  
  72.  
  73.  
  74.            TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
  75.         Whether or not the system will be equilibrated depends on the
  76.         scaling of the matrix A, but if equilibration is used, A is
  77.         overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
  78.         or diag(C)*B (if TRANS = 'T' or 'C').
  79.  
  80.      2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
  81.         matrix A (after equilibration if FACT = 'E') as
  82.            A = L * U,
  83.         where L is a product of permutation and unit lower triangular
  84.         matrices with KL subdiagonals, and U is upper triangular with
  85.         KL+KU superdiagonals.
  86.  
  87.      3. If some U(i,i)=0, so that U is exactly singular, then the routine
  88.         returns with INFO = i. Otherwise, the factored form of A is used
  89.         to estimate the condition number of the matrix A.  If the
  90.         reciprocal of the condition number is less than machine precision,
  91.         INFO = N+1 is returned as a warning, but the routine still goes on
  92.         to solve for X and compute error bounds as described below.
  93.  
  94.      4. The system of equations is solved for X using the factored form
  95.         of A.
  96.  
  97.      5. Iterative refinement is applied to improve the computed solution
  98.         matrix and calculate error bounds and backward error estimates
  99.         for it.
  100.  
  101.      6. If equilibration was used, the matrix X is premultiplied by
  102.         diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
  103.         that it solves the original system before equilibration.
  104.  
  105.  
  106. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  107.      FACT    (input) CHARACTER*1
  108.              Specifies whether or not the factored form of the matrix A is
  109.              supplied on entry, and if not, whether the matrix A should be
  110.              equilibrated before it is factored.  = 'F':  On entry, AFB and
  111.              IPIV contain the factored form of A.  If EQUED is not 'N', the
  112.              matrix A has been equilibrated with scaling factors given by R
  113.              and C.  AB, AFB, and IPIV are not modified.  = 'N':  The matrix A
  114.              will be copied to AFB and factored.
  115.              = 'E':  The matrix A will be equilibrated if necessary, then
  116.              copied to AFB and factored.
  117.  
  118.      TRANS   (input) CHARACTER*1
  119.              Specifies the form of the system of equations.  = 'N':  A * X = B
  120.              (No transpose)
  121.              = 'T':  A**T * X = B  (Transpose)
  122.              = 'C':  A**H * X = B  (Conjugate transpose)
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      N       (input) INTEGER
  141.              The number of linear equations, i.e., the order of the matrix A.
  142.              N >= 0.
  143.  
  144.      KL      (input) INTEGER
  145.              The number of subdiagonals within the band of A.  KL >= 0.
  146.  
  147.      KU      (input) INTEGER
  148.              The number of superdiagonals within the band of A.  KU >= 0.
  149.  
  150.      NRHS    (input) INTEGER
  151.              The number of right hand sides, i.e., the number of columns of
  152.              the matrices B and X.  NRHS >= 0.
  153.  
  154.      AB      (input/output) COMPLEX*16 array, dimension (LDAB,N)
  155.              On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
  156.              The j-th column of A is stored in the j-th column of the array AB
  157.              as follows:  AB(KU+1+i-j,j) = A(i,j) for max(1,j-
  158.              KU)<=i<=min(N,j+kl)
  159.  
  160.              If FACT = 'F' and EQUED is not 'N', then A must have been
  161.              equilibrated by the scaling factors in R and/or C.  AB is not
  162.              modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N'
  163.              on exit.
  164.  
  165.              On exit, if EQUED .ne. 'N', A is scaled as follows:  EQUED = 'R':
  166.              A := diag(R) * A
  167.              EQUED = 'C':  A := A * diag(C)
  168.              EQUED = 'B':  A := diag(R) * A * diag(C).
  169.  
  170.      LDAB    (input) INTEGER
  171.              The leading dimension of the array AB.  LDAB >= KL+KU+1.
  172.  
  173.      AFB     (input or output) COMPLEX*16 array, dimension (LDAFB,N)
  174.              If FACT = 'F', then AFB is an input argument and on entry
  175.              contains details of the LU factorization of the band matrix A, as
  176.              computed by ZGBTRF.  U is stored as an upper triangular band
  177.              matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the
  178.              multipliers used during the factorization are stored in rows
  179.              KL+KU+2 to 2*KL+KU+1.  If EQUED .ne. 'N', then AFB is the
  180.              factored form of the equilibrated matrix A.
  181.  
  182.              If FACT = 'N', then AFB is an output argument and on exit returns
  183.              details of the LU factorization of A.
  184.  
  185.              If FACT = 'E', then AFB is an output argument and on exit returns
  186.              details of the LU factorization of the equilibrated matrix A (see
  187.              the description of AB for the form of the equilibrated matrix).
  188.  
  189.      LDAFB   (input) INTEGER
  190.              The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      IPIV    (input or output) INTEGER array, dimension (N)
  207.              If FACT = 'F', then IPIV is an input argument and on entry
  208.              contains the pivot indices from the factorization A = L*U as
  209.              computed by ZGBTRF; row i of the matrix was interchanged with row
  210.              IPIV(i).
  211.  
  212.              If FACT = 'N', then IPIV is an output argument and on exit
  213.              contains the pivot indices from the factorization A = L*U of the
  214.              original matrix A.
  215.  
  216.              If FACT = 'E', then IPIV is an output argument and on exit
  217.              contains the pivot indices from the factorization A = L*U of the
  218.              equilibrated matrix A.
  219.  
  220.      EQUED   (input or output) CHARACTER*1
  221.              Specifies the form of equilibration that was done.  = 'N':  No
  222.              equilibration (always true if FACT = 'N').
  223.              = 'R':  Row equilibration, i.e., A has been premultiplied by
  224.              diag(R).  = 'C':  Column equilibration, i.e., A has been
  225.              postmultiplied by diag(C).  = 'B':  Both row and column
  226.              equilibration, i.e., A has been replaced by diag(R) * A *
  227.              diag(C).  EQUED is an input argument if FACT = 'F'; otherwise, it
  228.              is an output argument.
  229.  
  230.      R       (input or output) DOUBLE PRECISION array, dimension (N)
  231.              The row scale factors for A.  If EQUED = 'R' or 'B', A is
  232.              multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is
  233.              not accessed.  R is an input argument if FACT = 'F'; otherwise, R
  234.              is an output argument.  If FACT = 'F' and EQUED = 'R' or 'B',
  235.              each element of R must be positive.
  236.  
  237.      C       (input or output) DOUBLE PRECISION array, dimension (N)
  238.              The column scale factors for A.  If EQUED = 'C' or 'B', A is
  239.              multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is
  240.              not accessed.  C is an input argument if FACT = 'F'; otherwise, C
  241.              is an output argument.  If FACT = 'F' and EQUED = 'C' or 'B',
  242.              each element of C must be positive.
  243.  
  244.      B       (input/output) COMPLEX*16 array, dimension (LDB,NRHS)
  245.              On entry, the right hand side matrix B.  On exit, if EQUED = 'N',
  246.              B is not modified; if TRANS = 'N' and EQUED = 'R' or 'B', B is
  247.              overwritten by diag(R)*B; if TRANS = 'T' or 'C' and EQUED = 'C'
  248.              or 'B', B is overwritten by diag(C)*B.
  249.  
  250.      LDB     (input) INTEGER
  251.              The leading dimension of the array B.  LDB >= max(1,N).
  252.  
  253.      X       (output) COMPLEX*16 array, dimension (LDX,NRHS)
  254.              If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the
  255.              original system of equations.  Note that A and B are modified on
  256.              exit if EQUED .ne. 'N', and the solution to the equilibrated
  257.              system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B',
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  269.  
  270.  
  271.  
  272.              or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
  273.  
  274.      LDX     (input) INTEGER
  275.              The leading dimension of the array X.  LDX >= max(1,N).
  276.  
  277.      RCOND   (output) DOUBLE PRECISION
  278.              The estimate of the reciprocal condition number of the matrix A
  279.              after equilibration (if done).  If RCOND is less than the machine
  280.              precision (in particular, if RCOND = 0), the matrix is singular
  281.              to working precision.  This condition is indicated by a return
  282.              code of INFO > 0.
  283.  
  284.      FERR    (output) DOUBLE PRECISION array, dimension (NRHS)
  285.              The estimated forward error bound for each solution vector X(j)
  286.              (the j-th column of the solution matrix X).  If XTRUE is the true
  287.              solution corresponding to X(j), FERR(j) is an estimated upper
  288.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  289.              divided by the magnitude of the largest element in X(j).  The
  290.              estimate is as reliable as the estimate for RCOND, and is almost
  291.              always a slight overestimate of the true error.
  292.  
  293.      BERR    (output) DOUBLE PRECISION array, dimension (NRHS)
  294.              The componentwise relative backward error of each solution vector
  295.              X(j) (i.e., the smallest relative change in any element of A or B
  296.              that makes X(j) an exact solution).
  297.  
  298.      WORK    (workspace) COMPLEX*16 array, dimension (2*N)
  299.  
  300.      RWORK   (workspace/output) DOUBLE PRECISION array, dimension (N)
  301.              On exit, RWORK(1) contains the reciprocal pivot growth factor
  302.              norm(A)/norm(U). The "max absolute element" norm is used. If
  303.              RWORK(1) is much less than 1, then the stability of the LU
  304.              factorization of the (equilibrated) matrix A could be poor. This
  305.              also means that the solution X, condition estimator RCOND, and
  306.              forward error bound FERR could be unreliable. If factorization
  307.              fails with 0<INFO<=N, then RWORK(1) contains the reciprocal pivot
  308.              growth factor for the leading INFO columns of A.
  309.  
  310.      INFO    (output) INTEGER
  311.              = 0:  successful exit
  312.              < 0:  if INFO = -i, the i-th argument had an illegal value
  313.              > 0:  if INFO = i, and i is
  314.              <= N:  U(i,i) is exactly zero.  The factorization has been
  315.              completed, but the factor U is exactly singular, so the solution
  316.              and error bounds could not be computed. RCOND = 0 is returned.  =
  317.              N+1: U is nonsingular, but RCOND is less than machine precision,
  318.              meaning that the matrix is singular to working precision.
  319.              Nevertheless, the solution and error bounds are computed because
  320.              there are a number of situations where the computed solution can
  321.              be more accurate than the value of RCOND would suggest.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))                                                          ZZZZGGGGBBBBSSSSVVVVXXXX((((3333SSSS))))
  335.  
  336.  
  337.  
  338. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  339.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  340.  
  341.      This man page is available only online.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.